<?php
	//
	function preg_match_r($pattern, $haystack){
		static $results;
		foreach ($haystack as $k => $v) {
			if(is_array($v)){
				preg_match_r($pattern, $v);
			}else{
				if(preg_match($pattern, $v, $matches)){
					$results[$k] = $matches;
				}
			}
		}
		return $results;
	}
	//
?>